#define _CRT_SECURE_NO_WARNINGS 1
#include "String.h"


namespace wxd
{
	void TestString01()
	{
		string s1 = "Hello World!";
		string s4 = "666";
		cout << s1.c_str() << endl;

		string s2 = s1;
		cout << s2.c_str() << endl;

		string s3;
		s3 = s1;
		cout << s3.c_str() << endl;
		cout << s1.c_str() << endl;
		
	}

	void TestString02()
	{
		/*string s1;
		s1.push('a');
		s1.push('a');
		s1.push('a');
		s1.push('a');
		cout << s1.capacity() << endl;
		cout << s1.c_str() << endl;
		s1.push('b');
		cout << s1.capacity() << endl;
		cout << s1.c_str() << endl;

		string s2 = "abc";
		cout << s2.c_str() << endl;
		s2.append("efg");
		cout << s2.c_str() << endl;*/

		/*string s3;
		((s3 += 'a') += 'b') += 'c';
		cout << s3.c_str() << endl;

		string s4 = "Hello CPP!";
		(s4 += " Hello ") += "Linux!";
		cout << s4.c_str() << endl;*/

		string s5 = "Hello World!";
		cout << s5.c_str() << endl;

		/*s5.insert(5,'w');
		cout << s5.c_str() << endl;
		s5.insert(s5.size(), 'w');
		cout << s5.c_str() << endl;
		s5.insert(0, 'w');
		cout << s5.c_str() << endl;*/

		/*s5.insert(s5.size(), "hhhh");
		cout << s5.c_str() << endl;*/

		s5.erase(7,3);
		cout << s5 << endl;
		string s6;
		cin >> s6;
		cout << s6 << endl;
		string s7;
		s7.getline();
		cout << s7 << endl;
	}

	void TestString03()
	{
		string s1 = "Hello World!";
		size_t i = s1.find('l');

		if (i != (size_t)-1)
		{
			cout << i << endl;
		}
	}


	void TestString04()
	{
		/*string s1 = "Hello CPP";
		cout << s1 << endl;
		string::iterator it = s1.begin();
		while (it != s1.end())
		{
			cout << *it;
			it++;
		}
		cout << endl;*/


	/*	string s1 = "Hello World";
		string s2 = s1.substr(6,3);
		cout << s2 << endl;*/

		string s1 = "Hello World";
		/*cin >> s1;
		cout << s1;*/
		//s1.getline();
		cout << s1 << endl;

	}
}


int main()
{
	//wxd::TestString01();
	//wxd::TestString02();
	//wxd::TestString03();
	wxd::TestString04();
	return 0;
}